<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://eureka.yigolden.net/stringutils/sutaglib/1.0" prefix="su"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>查看留言</title>
<link type="text/css" href="${staticResources}/css/viewcommentadmin.css" rel="stylesheet" />
<script type="text/javascript" src="${staticResources}/js/ajax.js"></script>
<script type="text/javascript">
function replyComment(newstate) {
	var cid= document.getElementById("cid").value;
	var replycontent = document.getElementById("replycontent").value;
	var redirect_url = document.getElementById("redirect_url").value;
	var mode = "ajax";
	
	var params="cid=" + encodeURIComponent(cid);
	params+="&state="+newstate;
	params+="&replycontent="+encodeURIComponent(replycontent);
	params+="&redirect_url="+encodeURIComponent(redirect_url);
	params+="&mode="+encodeURIComponent(mode);
	
	if(newstate==1&&replycontent.length==0) {
		document.getElementById("message").innerHTML="<font color='red'>回复内容不能为空  </font>";
		return;
	}
	
	doAjax("ReplyComment"
			,params,function(rst){
		var rst=eval('(' +rst+ ')');
		if (rst.status == 0)
		{
			location.href = rst.redirectURL;
			return;
		}
		document.getElementById("message").innerHTML = rst.message;
		return;
	 });
}
</script>
</head>
<body style=" background: url('${staticResources}/image/greenbc.gif');">
<div id="header">
  <div id="hy">
    <c:if test="${user eq null }">
    <div id="logo">欢迎光临中国药科大学二手书交易平台!请<span><a href="${contextPath }/Account/Login">登录</a></span> 免费<span><a href="${contextPath }/Account/Register">注册</a></span></div>
    </c:if>
    <c:if test="${user ne null }">
    <div id="sc">
      <ul>
        <li><a href="${contextPath }/Account/Logout">注销</a></li>
        <li><a href="${contextPath }/Me?content=201">收藏夹</a></li>
        <li><a href="${contextPath }/Me">个人中心</a></li>
        <li>欢迎你，<b>${fn:escapeXml(user.nickName) }</b>！</li>
      </ul>
    </div>
    </c:if>
   </div>
   <div id="top" style=" background: url('${staticResources}/image/listcommentsbc_03.gif');">
      <div class="tx">
	    <dl>
	     <c:choose>
           <c:when test="${empty user.userPicture }">
             <img src="${staticResources}/image/userpics_none.jpg" width="132" height="132" alt="">
           </c:when>
           <c:otherwise>
             <img src="${userContents}/userpics/${user.userPicture }" width="132" height="132" alt="">
           </c:otherwise>
	     </c:choose>
	    </dl>
	  </div>
	  <div class="xx">
	     <dl class="nc">${fn:escapeXml(user.nickName)}</dl>
		 <dl class="degree">活跃度：${user.activityPoint}</dl>
		 <dl class="degree">信誉度：${user.creditPoint}</dl>
		 <dl class="degree">个性签名：${fn:escapeXml(user.signature)}</dl>
	  </div>
   </div>
 </div>
   <div id="nav" style=" background: url('${staticResources}/image/listcomments_07.gif');">
    <ul>
      <li><a href="${contextPath }/Homepage">首页</a></li>
      <li><a href="${contextPath }/Books/Search">交易广场</a></li>
      <li><a href="${contextPath }/Auctions/Search">拍卖中心</a></li>
      <li><a href="#">读者推荐</a></li>
      <li><a href="${contextPath }/Comment/ListComments">留言板</a></li>
      <li><a href="#">新手指南</a></li>
    </ul>
   </div>
 
 
<!--头部结束-->
<div id="divmiddle"  style=" background: url('${staticResources}/image/viewcomment_background2.jpg');">  
  <p style="height:30px;"></p>
  <div id="divcomment">
    <div id="divcommentleft">
      <c:choose>
        <c:when test="${empty comment.commentUser.userPicture }">
          <img id="imgcomment" src="${staticResources}/image/userpics_none.jpg">
        </c:when>
        <c:otherwise>
          <img id="imgcomment" src="${userContents}/userpics/${comment.commentUser.userPicture }">
        </c:otherwise>
      </c:choose>
    </div>
    <div id="divcommentright">
      <div id="divcommentnickname">${fn:escapeXml(comment.commentUser.nickName)}</div>
      <div id="divcommenttitle">标题：${fn:escapeXml(comment.title)}</div>
      <div id="divcommentmassege">${fn:escapeXml(comment.content)}</div>
      <div id="divcondition">
        <div id="divstate">${fn:escapeXml(comment.commentState.friendlyName)}</div><div id="divtime">${fn:escapeXml(comment.formattedCommentTime)}</div>
      </div>
      <form method="post" action="ReplyComment" onsubmit="replyComment(1);return false;" >
      	<input type="hidden" name="cid" id="cid" value="${fn:escapeXml(comment.CID)}" />
        <textarea rows="10" cols="60" id="replycontent" ></textarea>
        <div id="divmessage"><label id="message"></label></div>
        <div id="divgocomment"><input type="image" onclick="replyComment(1);return false;" src="${staticResources}/image/viewcommentadmin_1.png"/></div>
        <div id="divgoback"><input type="image" onclick="replyComment(2);return false;" src="${staticResources}/image/viewcommentadmin_2.png" /></div>
        <input type="hidden" name="redirect_url" id="redirect_url" value="${su:encodeLink(param.redirect_url) }" />
      </form>
    </div>
  </div>
</div>
<!--中间部分结束-->
<div class="bottom">中国药科大学版权所有</div>

<!--尾部结束-->


</body>
</html>
